#pragma once
#include "test.h"
#include <vector>

class test_rvalue :public TestBase{
public:
    test_rvalue() : TEST {}
    /**
     * http://blog.csdn.net/gatieme/article/details/22650353
     * https://stackoverflow.com/questions/4986673/c11-rvalues-and-move-semantics-confusion-return-statement
     */
    void do_test() {
        std::vector<int> ret_vector = test_ret_vector();
        std::cout<< &ret_vector<<endl;
        int rint = test_ret_int();
        std::cout<< &rint<<endl;
    }

 private:
    std::vector<int> test_ret_vector() {
        std::vector<int> ret;
        ret.push_back(9);
        ret.push_back(10);

        std::cout<< &ret<<endl;
        return ret;
    }
    int test_ret_int() {
        int ret = 10000;
        std::cout<< &ret<<endl;
        return ret;
    }
};
